<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">


<div class="table-responsive">
    <table class="table table-bordered">
        <thead>
        <tr>
            <th class="text-center">
                <div class="table-first-id">ID</div>
            </th>
            <th class="text-center" width="23%">话题标题</th>
            <th class="text-center" width="15%">关联班级</th>
            <th class="text-center" width="8%">话题类型</th>
            <th class="text-center" width="12%">创建人</th>
            <th class="text-center" width="6%">浏览量</th>
            <th class="text-center" width="6%">回复量</th>
            <th class="text-center" width="6%">点赞量</th>
            <th class="text-center" width="6%">状态</th>
            <th class="text-center" width="13%">操作</th>
        </tr>
        </thead>
    </table>
    <div class="J_V_tabContent table-xScrollWrap">
        <table class="table table-bordered table-hover table-xs-content">
            <tbody id="tbodyMaterial">
            <tr class="jqgfirstrow" role="row">
                <td class="text-center">
                    <div class="table-first-id"></div>
                </td>
                <td class="text-center" width="23%">&nbsp;</td>
                <td class="text-center" width="15%">&nbsp;</td>
                <td class="text-center" width="8%">&nbsp;</td>
                <td class="text-center" width="12%">&nbsp;</td>
                <td class="text-center" width="6%">&nbsp;</td>
                <td class="text-center" width="6%">&nbsp;</td>
                <td class="text-center" width="6%">&nbsp;</td>
                <td class="text-center" width="6%">&nbsp;</td>
                <td class="text-center" width="13%">&nbsp;</td>
            </tr>
            <tr th:if="${#maps.isEmpty(dataMap)} or ${#lists.isEmpty(dataMap['list'])}">
                <td colspan="11" class="text-center">
                <div class="noDataTipsBox">
                    <p><span class="c-4e fs16">还没有话题~~~</span></p>
                </div>
                </td>
            </tr>

            <tr th:each="topic : ${dataMap['list']}" th:attrappend="data-id=${topic['id']}">
                <td class="text-center">
                    <input type="checkbox" class="i-checks" name="id" th:value="${topic['id']}">
                </td>
                <td class="text-center" th:utext="${topic['title']}"></td>
                <td class="text-center" th:text="${topic['classes']!=null&&topic['classes']['name']!=null?topic['classes']['name']:'-'}"></td>
                <td class="text-center">
                    <span class="label label-info" th:text="${topic['topicTypeName']}"></span>
                </td>
                <td class="text-center" th:if="${topic['source']}==1" th:text="${topic['createUser']!=null&&topic['createUser']['nickname'] != null ?topic['createUser']['nickname'] : ''}"></td>
                <td class="text-center" th:if="${topic['source']}==2" th:text="${topic['createUser']!=null&&topic['createUser']['ralName'] != null ? '[管理员创建]'+topic['createUser']['ralName'] :''}"></td>
                <td class="text-center" th:if="${topic['source']}==3" th:text="${topic['createUser']!=null&&topic['createUser']['teacherName'] != null ?'[教师创建]'+topic['createUser']['teacherName'] :''}"></td>
                <td class="text-center" th:text="${topic['lookNum']}"></td>
                <td class="text-center" th:text="${topic['replyNum']}"></td>
                <td class="text-center" th:text="${topic['likeNum']}"></td>
                <td class="text-center" data-status>
                    <span class="label label-info" th:if="${topic['status'] == 1}">正常</span>
                    <span class="label label-danger" th:if="${topic['status'] == 2}">禁用</span>
                </td>
                <td class="text-center">
                    <a th:href="@{/admin/classes/topic/previewTopic?id={id}(id=${topic['id']})}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="top" data-original-title="查看"><i class="fa fa-eye"></i> </a>
                    <a th:href="@{/admin/classes/topic/initUpdate?id={id}(id=${topic['id']})}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="top" data-original-title="编辑"><i class="fa fa-edit"></i> </a>
                    <a th:if="${topic['top']} == 2" href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="top" data-original-title="置顶"><i class="fa fa-arrow-up"></i> </a>
                    <a th:if="${topic['top']} == 1" href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="top" data-original-title="取消置顶"><i class="fa fa-arrow-down"></i> </a>
                    <a th:if="${topic['status']} == 1" href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="top" data-original-title="禁用"><i class="fa fa-unlock-alt"></i> </a>
                    <a th:if="${topic['status']} == 2" href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="top" data-original-title="恢复"><i class="fa fa-history"></i> </a>
                    <a href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="top" data-original-title="删除"><i class="fa fa-trash"></i> </a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>

    <!-- 分页，开始 -->
    <div data-th-replace="layout/adminPage"></div>
    <!-- 分页，结束 -->
</div>

</html>
